/**
 * Package	: com.coship.adstorm.web.advertisement.action
 * File		: AdvertisementAction.java
 * Company 	: Shenzhen Coship Electronics CO., LTD.
 * Version  : v1.0
 * Description 	: <Detail Description for package>
 *
 * Copyright (c) 2003-2009 Shenzhen Coship Electronics CO., LTD.
 * Rainbow Bldg.,North,Hi-Tech Industrial Park,Nanshan District,Shenzhen,China,P.C.518057.
 * All rights reserved.
 * The contents of this file are confidential and proprietary to COSHIP.
 * Copying is explicitly prohibited without the express permission of COSHIP.
 *
 * Create Date	: Apr 22, 2010
 * Create By    : 904147
 * History :$
 */
package com.coship.vasms.adstorm.web.advertisement.action;

import java.util.List;

import net.sf.json.JSONArray;

import org.apache.log4j.Logger;

import com.coship.vasms.adstorm.common.BeanHelper;
import com.coship.vasms.adstorm.model.Advertisement;
import com.coship.vasms.adstorm.service.AdvertisementService;
import com.coship.vasms.adstorm.web.BaseAction;

/** 
 * 
 * File Name    : AdvertisementAction.java
 * @Description 	: <Detail Description for Class >
 * @author 904147
 */
public class AdvertisementAction extends BaseAction{

	
	/**
	 * Description 	: <Detail Description for package>
	 * Author       : 904147
	 */
	private static final long serialVersionUID = 1L;
	
	private static final Logger logger = Logger
			.getLogger(AdvertisementAction.class);
	
	private String jsonString;
	
	private Advertisement advertisement;
	
	/**
	 * 
	 * Description 	: <Detail Description for method>
	 *
	 * @return
	 *
	 */
	public String list(){
		AdvertisementService adService = (AdvertisementService)BeanHelper
			.getInstance().getBean("advertisementService");
		//Integer count = adService.queryAdCount(advertisement);
		
		List<Advertisement> adList = null;
		//adList = adService.queryAd(advertisement);
		if(adList.size()==0){
			return jsonString="";
		}
		for(int i=0;i<adList.size();i++){
			Advertisement ad = adList.get(i);
			JSONArray jsonA = new JSONArray();
			//jsonA.put(ad);
		}
		return jsonString;
	}
	
	public static void main(String[] arges){
		JSONArray jsonA = new JSONArray();
		Advertisement ad = new Advertisement();
		ad.setAdvertiseCode("code");
		ad.setAdvertiseId(1);
		ad.setAdvertiseName("name");
		ad.setAdvertiseType(2);
		//jsonA.put(ad);
		System.out.print("jsonString = "+jsonA.toString());
	}
}
